Hello, Quarto

library(ggplot2)
library(plotly)

Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':

    last_plot
The following object is masked from 'package:stats':

    filter
The following object is masked from 'package:graphics':

    layout
df <- read.csv('data/processed-data/gender_inequality_and_economic_indicators_dataset_clean_final.csv')
cat('Can a woman choose where to live in the same way as a man?\n',table(df$Can.a.woman.choose.where.to.live.in.the.same.way.as.a.man.), '\n Yes No')
Can a woman choose where to live in the same way as a man?
 37 153 
 Yes No
mob_plt_1 <- ggplot(df, aes(x = Can.a.woman.choose.where.to.live.in.the.same.way.as.a.man., fill = Region)) +
    geom_bar(position = "dodge") + # 'dodge' puts bars side by side
    labs(title = "Can a woman choose where to live in the same way as a man by Region", x = "Can a woman choose where to live in the same way as a man", y = "Count") +
    theme_minimal()

ggplotly(mob_plt_1)
mob_plt_2 <- ggplot(df, aes(x = Can.a.woman.travel.outside.her.home.in.the.same.way.as.a.man., fill = Region)) +
    geom_bar(position = "dodge") + # 'dodge' puts bars side by side
    labs(title = "Can a woman travel outside her home in the same way as a man", x = "Can a woman travel outside her home in the same way as a man", y = "Count") +
    theme_minimal()

ggplotly(mob_plt_2)
mob_plt_3 <- ggplot(df, aes(x = Can.a.woman.apply.for.a.passport.in.the.same.way.as.a.man., fill = Region)) +
    geom_bar(position = "dodge") + # 'dodge' puts bars side by side
    labs(title = "Can a woman apply for a passport in the same way as a man", x = "Can a woman apply for a passport in the same was as a man", y = "Count") +
    theme_minimal()

ggplotly(mob_plt_3)
mob_plt_4 <- ggplot(df, aes(x = Can.a.woman.travel.outside.the.country.in.the.same.way.as.a.man., fill = Region)) +
    geom_bar(position = "dodge") + # 'dodge' puts bars side by side
    labs(title = "Can a woman travel outside the country in the same way as a man?", x = "Can a woman travel outside the country in the same way as a man?", y = "Count") +
    theme_minimal()

ggplotly(mob_plt_4)
mobility_p <- ggplot(df, aes(x = MOBILITY, fill = Region)) +
    geom_bar(position = "dodge") + # 'dodge' puts bars side by side
    labs(title = "Mobility Score (out of 100) by Region", x = "Mobility", y = "Count") +
    theme_minimal()

ggplotly(mobility_p)
# Welch Two Sample t-test
t_test_result <- t.test(MOBILITY ~ Can.a.woman.choose.where.to.live.in.the.same.way.as.a.man., data = df)

print(t_test_result)

    Welch Two Sample t-test

data:  MOBILITY by Can.a.woman.choose.where.to.live.in.the.same.way.as.a.man.
t = -11.11, df = 38.442, p-value = 1.449e-13
alternative hypothesis: true difference in means between group No and group Yes is not equal to 0
95 percent confidence interval:
 -58.07865 -40.18138
sample estimates:
 mean in group No mean in group Yes 
         46.62162          95.75163 
# Welch Two Sample t-test
t_test_result <- t.test(MOBILITY ~ Can.a.woman.travel.outside.her.home.in.the.same.way.as.a.man., data = df)

print(t_test_result)

    Welch Two Sample t-test

data:  MOBILITY by Can.a.woman.travel.outside.her.home.in.the.same.way.as.a.man.
t = -12.536, df = 17.37, p-value = 3.921e-10
alternative hypothesis: true difference in means between group No and group Yes is not equal to 0
95 percent confidence interval:
 -78.48727 -55.90579
sample estimates:
 mean in group No mean in group Yes 
         25.00000          92.19653 
# Welch Two Sample t-test
t_test_result <- t.test(MOBILITY ~ Can.a.woman.apply.for.a.passport.in.the.same.way.as.a.man., data = df)

print(t_test_result)

    Welch Two Sample t-test

data:  MOBILITY by Can.a.woman.apply.for.a.passport.in.the.same.way.as.a.man.
t = -8.5657, df = 48.039, p-value = 3.098e-11
alternative hypothesis: true difference in means between group No and group Yes is not equal to 0
95 percent confidence interval:
 -46.41090 -28.76507
sample estimates:
 mean in group No mean in group Yes 
         56.70732          94.29530 
# Welch Two Sample t-test
t_test_result <- t.test(MOBILITY ~ Can.a.woman.travel.outside.the.country.in.the.same.way.as.a.man., data = df)

print(t_test_result)

    Welch Two Sample t-test

data:  MOBILITY by Can.a.woman.travel.outside.the.country.in.the.same.way.as.a.man.
t = -18.855, df = 10.716, p-value = 1.46e-09
alternative hypothesis: true difference in means between group No and group Yes is not equal to 0
95 percent confidence interval:
 -89.83431 -70.99902
sample estimates:
 mean in group No mean in group Yes 
         10.00000          90.41667